/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author guillaumediliberatore
 */
@Entity
@Table(name = "sinistre_habitat")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SinistreHabitat.findAll", query = "SELECT s FROM SinistreHabitat s"),
    @NamedQuery(name = "SinistreHabitat.findByNumsinistrehabitat", query = "SELECT s FROM SinistreHabitat s WHERE s.numsinistrehabitat = :numsinistrehabitat"),
    @NamedQuery(name = "SinistreHabitat.findByMontantdegat", query = "SELECT s FROM SinistreHabitat s WHERE s.montantdegat = :montantdegat"),
    @NamedQuery(name = "SinistreHabitat.findByDescription", query = "SELECT s FROM SinistreHabitat s WHERE s.description = :description"),
    @NamedQuery(name = "SinistreHabitat.findByNumcontrathabitat", query = "SELECT s FROM SinistreHabitat s WHERE s.numcontrathabitat = :numcontrathabitat"),
    @NamedQuery(name = "SinistreHabitat.findByNumExpert", query = "SELECT s FROM SinistreHabitat s WHERE s.numExpert = :numExpert"),
    @NamedQuery(name = "SinistreHabitat.findByNumRedacteur", query = "SELECT s FROM SinistreHabitat s WHERE s.numRedacteur = :numRedacteur"),
    @NamedQuery(name = "SinistreHabitat.findByMontantremboursement", query = "SELECT s FROM SinistreHabitat s WHERE s.montantremboursement = :montantremboursement"),
    @NamedQuery(name = "SinistreHabitat.findByStatut", query = "SELECT s FROM SinistreHabitat s WHERE s.statut = :statut"),
    @NamedQuery(name = "SinistreHabitat.findByTypeincident", query = "SELECT s FROM SinistreHabitat s WHERE s.typeincident = :typeincident"),
    @NamedQuery(name = "SinistreHabitat.findByLieu", query = "SELECT s FROM SinistreHabitat s WHERE s.lieu = :lieu"),
    @NamedQuery(name = "SinistreHabitat.findByDate", query = "SELECT s FROM SinistreHabitat s WHERE s.date = :date")})
public class SinistreHabitat implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "numsinistrehabitat")
    private Integer numsinistrehabitat;
    @Column(name = "montantdegat")
    private BigInteger montantdegat;
    @Size(max = 500)
    @Column(name = "description")
    private String description;
    @Size(max = 50)
    @Column(name = "numcontrathabitat")
    private String numcontrathabitat;
    @Size(max = 50)
    @Column(name = "num_expert")
    private String numExpert;
    @Size(max = 50)
    @Column(name = "num_redacteur")
    private String numRedacteur;
    @Column(name = "montantremboursement")
    private BigInteger montantremboursement;
    @Size(max = 30)
    @Column(name = "statut")
    private String statut;
    @Size(max = 50)
    @Column(name = "typeincident")
    private String typeincident;
    @Size(max = 40)
    @Column(name = "lieu")
    private String lieu;
    @Size(max = 30)
    @Column(name = "date")
    private String date;

    public SinistreHabitat() {
    }

    public SinistreHabitat(Integer numsinistrehabitat) {
        this.numsinistrehabitat = numsinistrehabitat;
    }
    
    public SinistreHabitat(String numero, String date, String adresse, String description, String incident){
        this.date = date;
        this.description = description;
        this.lieu = adresse;
        this.numcontrathabitat = numero;
        this.typeincident = incident;
    }

    public Integer getNumsinistrehabitat() {
        return numsinistrehabitat;
    }

    public void setNumsinistrehabitat(Integer numsinistrehabitat) {
        this.numsinistrehabitat = numsinistrehabitat;
    }

    public BigInteger getMontantdegat() {
        return montantdegat;
    }

    public void setMontantdegat(BigInteger montantdegat) {
        this.montantdegat = montantdegat;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getNumcontrathabitat() {
        return numcontrathabitat;
    }

    public void setNumcontrathabitat(String numcontrathabitat) {
        this.numcontrathabitat = numcontrathabitat;
    }

    public String getNumExpert() {
        return numExpert;
    }

    public void setNumExpert(String numExpert) {
        this.numExpert = numExpert;
    }

    public String getNumRedacteur() {
        return numRedacteur;
    }

    public void setNumRedacteur(String numRedacteur) {
        this.numRedacteur = numRedacteur;
    }

    public BigInteger getMontantremboursement() {
        return montantremboursement;
    }

    public void setMontantremboursement(BigInteger montantremboursement) {
        this.montantremboursement = montantremboursement;
    }

    public String getStatut() {
        return statut;
    }

    public void setStatut(String statut) {
        this.statut = statut;
    }

    public String getTypeincident() {
        return typeincident;
    }

    public void setTypeincident(String typeincident) {
        this.typeincident = typeincident;
    }

    public String getLieu() {
        return lieu;
    }

    public void setLieu(String lieu) {
        this.lieu = lieu;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (numsinistrehabitat != null ? numsinistrehabitat.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SinistreHabitat)) {
            return false;
        }
        SinistreHabitat other = (SinistreHabitat) object;
        if ((this.numsinistrehabitat == null && other.numsinistrehabitat != null) || (this.numsinistrehabitat != null && !this.numsinistrehabitat.equals(other.numsinistrehabitat))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.SinistreHabitat[ numsinistrehabitat=" + numsinistrehabitat + " ]";
    }
    
}
